package com.yuanqi.hnucshop.utils;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class JsonResult<E> implements Serializable {

    private Integer state;

    private String massage;

    private E data;

    public JsonResult(int state) {
        this.state = state;
    }

    public JsonResult(int state, E data) {
        this.state = state;
        this.data = data;
    }

    public JsonResult(Throwable e) {
        this.massage = e.getMessage();
    }


}
